#ifndef IMPORT_H
#define IMPORT_H

#include <QDialog>
#include <QXmlStreamReader>


class QLabel;
class QLineEdit;
class QPushButton;

class ImportDlg : public QDialog
{
    Q_OBJECT

public:
    ImportDlg(QWidget *parent = 0);

signals:
    void importFinished();

private slots:
    void SearchFile();
    void SaveToDataBase();

private:
    void paintEvent(QPaintEvent *);
    bool ReadFile(const QString &fileName);
    void ReadItemInfo();
    void ReadItem();
    void ReadArea();
    void ReadRidgePole();
    void ReadLayer();
    void ReadRoom();
    void ReadDevName();
    void CreateWidget();
    void ImportToDataBase();

    QString id;
    QString area;
    QString ridgepole;
    QString layer;
    QString room;
    QString devName;

    QLabel *hintLabel;
    QString filePathStr;
    QLineEdit *lineEdit;
    QPushButton *importBtn;
    QPushButton *cancleBtn;
    QPushButton *openFileBtn;

    QXmlStreamReader reader;
};

#endif // IMPORT_H
